package cn.momoshenchi.service;

import cn.momoshenchi.pojo.Book;
import com.baomidou.mybatisplus.extension.service.IService;

import java.io.IOException;
import java.util.List;

/**
 *
 */
public interface BookService extends IService<Book> {

    /**
     * 对title和description字段进行模糊查询
     * @param keyword
     * @return
     */
    List<Book> search(String keyword);

    /**
     * 添加书籍同时加入es
     * @param book
     */
    void insertWithEs(Book book) throws IOException;

    /**
     * 批量添加书籍同时加入es
     * @param bookList
     */
    void insertListWithEs(List<Book> bookList) throws IOException;
}
